<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }
    .parent {
      width: 100px;
      height: 100px;
      border: 1px solid black;
      
    }
    .parent::after {
      content: '';
      display: inline-block;
      height:100%;
      vertical-align:middle;
    }
    /* 行内块级元素*/
    .child {
      display: inline-block;
      width: 50px;
      height: 50px;
      /* vertical-align:middle;  */
      background-color: green;
    }
    /* 行内元素*/
    .child1 {
      display: inline;
      background-color: red;
    }
  </style>
</head>
<body>
  <div class="parent">
    <div class="child"></div>
    <div class="child1">ss1</div>
  </div>
</body>
</html>